<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05操作节点</title>
</head>
<body>
<div id="demo">
    <div id="one"></div>
    <div id="two"></div>
</div>
<script>
    var demo = document.getElementById("demo");
    var one = document.getElementById("one");
    //创建节点
    var three = document.createElement("div");
    //在后面添加节点
    demo.appendChild(three);
    //在前面插入节点
    demo.insertBefore(three,null);
    //删除节点
    demo.removeChild(one);
    //深克隆节点
    var cloneNode = demo.cloneNode(true);
    //克隆完要追加才能看到
    demo.parentNode.appendChild(cloneNode);
</script>
</body>
</html>